<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>{$meta_title}</h2>
    </div>

    <div class="cf">
        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" class="search-input" name="name" value="{:I('name')}" placeholder="请输入课程名称">
            </div>
            <a class="sch-btn" href="javascript:;" id="search" url="{:U('videoQuestionList')}"><i class="btn-search"></i></a>
        </div>

    </div>

    <!-- 数据列表 -->
    <div class="data-table table-striped">
        <table>
            <thead>
            <tr>
                <th>ID</th>
                <th>课程名称</th>
                <th>视频名称</th>
                <th>问题</th>
                <th>答复内容</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            <notempty name="_list">
                <volist name="_list" id="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.name}</td>
                        <td>{$vo.video_name}</td>
                        <td>{$vo.question}</td>
                        <td>{$vo.answer}</td>
                        <td>{$vo.create_time|time_format}</td>
                        <td>
                            <a href="{:U('upVideoQuestion',array('id'=>$vo['id']))}" class="authorize">答复</a>
<!--                            <a href="{:U('delVideoQuestion',array('id'=>$vo['id']))}" class="authorize">删除</a>-->
                        </td>
                    </tr>
                </volist>
                <else/>
                <td colspan="7" class="text-center"> aOh! 暂时还没有内容! </td>
            </notempty>
            </tbody>
        </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">

        //搜索功能
        $('#search').click(function(){
            var url = $(this).attr('url').replace('.html', '');
            var query  = $('.search-form').find('input').serialize();
            var squery = $('.search-form').find('select').serialize();
            query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            query = query.replace(/^&/g,'');
            squery=squery.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
            squery=squery.replace(/^&/g,'');
            if( url.indexOf('?')>0 ){
                url += '&' + query+'&'+squery;
            }else{
                url += '?' + query+'&'+squery;
            }
            window.location.href = url;
        });
        //导航高亮
        highlight_subnav('{:U("Manage/videoQuestionList")}');
    </script>
</block>